<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>Login</title>

    <link href="resources/css/style.css" rel="stylesheet">
    <link href="resources/css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="resources/js/html5shiv.js"></script>
    <script src="resources/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin">
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">物流入出库登录</h1>
        </div>
        <div class="login-wrap">
            <input id="login_username" type="text" class="form-control" placeholder="用户名" autofocus>
            <input id="login_password" type="password" class="form-control" placeholder="密码">
            <span id="login_error" style="color: red;" hidden="true">用户名密码错误！</span>
            <button id="login_submit" class="btn btn-lg btn-login btn-block" type="button">
                <i class="fa fa-check"></i>
            </button>

            <div class="registration">
                没有账号？
                <a class="" href="/register">
                    注册
                </a>
            </div>
            <!--
            <label class="checkbox">
                <input type="checkbox" value="remember-me"> 记住我
                <span class="pull-right">
                    <a data-toggle="modal" href="#myModal"> 忘记密码?</a>
                </span>
            </label>
            -->
        </div>

        <!-- Modal -->
        <!--
        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">忘记密码 ?</h4>
                    </div>
                    <div class="modal-body">
                        <p>请输入你的邮箱来重置密码.</p>
                        <input type="text" name="email" placeholder="邮箱" autocomplete="off" class="form-control placeholder-no-fix">

                    </div>
                    <div class="modal-footer">
                        <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
                        <button class="btn btn-primary" type="button">提交</button>
                    </div>
                </div>
            </div>
        </div>
        -->
        <!-- modal -->

    </form>

</div>

<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="resources/js/jquery-1.10.2.min.js"></script>
<script src="resources/js/bootstrap.min.js"></script>
<script src="resources/js/modernizr.min.js"></script>

<script type="text/javascript">
    
    $("#login_submit").click(function(){
    
        var login_param = {
            "username":$("#login_password").val(),
            "password":$("#login_password").val()
        };

        $.post("/login",login_param,function(response){
           if(response.status=="success"){
                window.location = "/index";
           }else{
            $("#login_error").removeAttr("hidden");
           }
        });
    });
</script>

</body>
</html>
